Skip to content

chore: fix copy-paste mistakes#13281

Merged
kgryte merged 2 commits into
developfrom
philipp/drift-stats-base-dists-betaprime-2026-07-05
Jul 5, 2026
Merged

chore: fix copy-paste mistakes#13281
kgryte merged 2 commits into
developfrom
philipp/drift-stats-base-dists-betaprime-2026-07-05

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

Corrects copy-paste-derived identifiers in two @stdlib/stats/base/dists/betaprime sibling packages surfaced by a cross-package majority-vote audit of the namespace's twelve members. Both fixes are docs-only, mechanical renames; no observable behavior changes and no test expectations move.

Namespace summary: 12 members audited (cdf, ctor, kurtosis, logcdf, logpdf, mean, mode, pdf, quantile, skewness, stdev, variance). Structural pass (file tree, package.json, manifest.json, README section shape, keywords, benchmarks/tests/examples layout) and semantic pass (public signatures, validation prologues, error construction, JSDoc, dependencies) yielded high uniformity within the C-implementation and no-C sub-groups. Two features had a ≥75% majority with a single-package outlier and a mechanical fix; other candidate drifts (e.g. explicit isnan on shape parameters in moment functions, Notes section presence in READMEs, package.json gypfile presence) fell below threshold or tracked with legitimate structural differences and were dropped.

@stdlib/stats/base/dists/betaprime/mode

Rename the equation label, data-equation, and alt identifiers from eq:betaprime_expectation / "Expected value for a beta prime distribution." to eq:betaprime_mode / "Mode for a beta prime distribution." — leftovers copy-pasted from mean/README.md. Rendered SVG and raw LaTeX are unchanged; this only aligns the identifiers with the sibling packages, ten of eleven of which already name the label after their own function.

@stdlib/stats/base/dists/betaprime/variance

Rename the local binding in docs/types/test.ts from stdev to variance at the import and all twenty call sites; the file was a byte-identical copy of the sibling stdev package's test with the alias never renamed. Behavior is unchanged — the import still resolves ./index to variance's declaration and dtslint asserts the same surface — but the fixture now matches the package under test and aligns with the convention used in ten of the eleven sibling betaprime distribution packages.

Related Issues

None.

Questions

No.

Other

Validation. Structural features were extracted for every member; semantic features (public signature, validation prologue, error construction, JSDoc shape, dependencies) were extracted via a per-package pass over lib/main.js and adjacent sources. Both surviving corrections were then independently reviewed for (a) whether the deviation might reflect a legitimate semantic difference between the outlier and its siblings and (b) whether tests or examples rely on the deviating identifier — both came back confirmed as unintentional copy-paste artifacts with no downstream dependence. Deliberately excluded: outlier structural features that track with C-implementation status (e.g. gypfile, manifest.json, docs/img/, src/, include.gypi), features without a clear namespace-wide majority (README Notes section, moment-function isnan prologues), and the misnamed mode/docs/img/equation_betaprime_expectation.svg file itself (rename would break the CDN URL pinned to a historical commit hash; the metadata correction here is safe and self-contained).

The pinned CDN URL in mode/README.md is intentionally left unchanged: it references the current filename at a historical stdlib commit and continues to resolve to the correctly-rendered mode SVG. A future filename rename can be paired with a coordinated CDN commit-hash bump.

Checklist

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

This PR was written primarily by Claude Code as part of a scheduled cross-package drift-detection routine. The namespace was picked uniformly at random; drift was surfaced by a majority-vote analysis of structural and semantic features across the twelve betaprime sibling packages; only mechanical fixes with a clear ≥75%-conformance majority and no behavior impact were retained. Independent verification passes confirmed both fixes as unintentional copy-paste from the neighboring sibling.


@stdlib-js/reviewers


Generated by Claude Code

…ime/mode`

The README's equation `label`, `data-equation`, and image `alt` attributes
were copy-pasted from the `mean` sibling and never renamed, describing the
mode as an expected value while the rendered LaTeX and SVG correctly show
the mode piecewise formula.

Ten of eleven sibling packages in the namespace name the equation after
the package's own function; align `mode` with that pattern by replacing
`eq:betaprime_expectation` with `eq:betaprime_mode` and updating both
`alt` attributes to "Mode for a beta prime distribution.". The SVG
filename and pinned CDN URL are left alone so the image reference
continues to resolve at the historical commit.
…ts/betaprime/variance`

The type test file was byte-identical to the `stdev` sibling: `./index`
was aliased as `stdev` and every `$ExpectType`/`$ExpectError` call site
used that name. Ten of eleven sibling packages bind `./index` to their
own function name in `docs/types/test.ts`; rename the alias and its call
sites to `variance` so the type test reads as belonging to this package.
The imported module is unchanged, so dtslint assertions still exercise
the same declarations.
@stdlib-bot stdlib-bot added the Statistics Issue or pull request related to statistical functionality. label Jul 5, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/betaprime/mode $\\color{green}196/196$
$\\color{green}+100.00\\%$
$\\color{green}10/10$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}196/196$
$\\color{green}+100.00\\%$
stats/base/dists/betaprime/variance $\\color{green}205/205$
$\\color{green}+100.00\\%$
$\\color{green}10/10$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}205/205$
$\\color{green}+100.00\\%$

The above coverage report was generated for the changes in this PR.

@kgryte kgryte marked this pull request as ready for review July 5, 2026 09:53
@kgryte kgryte requested a review from a team July 5, 2026 09:53
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Jul 5, 2026
@kgryte kgryte changed the title docs: correct copy-paste-derived identifiers in stats/base/dists/betaprime chore: fix copy-paste mistakes Jul 5, 2026
@kgryte kgryte merged commit 6e257ba into develop Jul 5, 2026
54 checks passed
@kgryte kgryte deleted the philipp/drift-stats-base-dists-betaprime-2026-07-05 branch July 5, 2026 09:53
@kgryte kgryte removed the Needs Review A pull request which needs code review. label Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants